<link rel="stylesheet" href="__CDN__/assets/element-ui-2.15.14/css/index.css">
<link rel="stylesheet" href="__CDN__/assets/css/vvv.css">
<style>
    .el-form-item__label {
        width: 120px !important;
    }

    .el-tag + .el-tag {
        margin-left: 10px;
    }

    .button-new-tag {
        margin-left: 10px;
        height: 32px;
        line-height: 30px;
        padding-top: 0;
        padding-bottom: 0;
    }

    .input-new-tag {
        width: 90px;
        margin-left: 10px;
        vertical-align: bottom;
    }

    input[type="file"] {
        display: none !important;
    }

    .el-form-item__error {
        margin-left: 30px;
    }

    .search-select .el-input--suffix .el-input__inner {
        width: 130px;
    }

    .level-bg {
        color: #fff;
        padding: 10px;
        width: 100px;
        text-align: center;
        margin: 0 auto;
        border-radius: 4px;
    }
</style>
<div id="vue" v-cloak>
    <div class="screen-container">
        <div class="screen-container-show">
            <el-button style="margin-top: 14px;" size="small" @click="refreshPage" icon="el-icon-refresh" circle
                       type="primary"></el-button>
            <div class="screen-container-left display-flex">
                <div class="datetime">
                    <el-date-picker
                            value-format="yyyy-MM-dd HH:mm:ss"
                            v-model="search.startTime"
                            type="datetime"
                            placeholder="选择起始时间">
                    </el-date-picker>
                </div>
                <div class="datetime">
                    <el-date-picker
                            value-format="yyyy-MM-dd HH:mm:ss"
                            v-model="search.endTime"
                            type="datetime"
                            placeholder="选择结束时间">
                    </el-date-picker>
                </div>
            </div>
            <div class="search-select screen-container-right display-flex keyword">
                <el-select v-model="search.aid" @clear="handleClearSelect('aid')" clearable placeholder="活动列表">
                    <el-option
                            v-for="item in activityList"
                            :key="item.id"
                            :label="item.title"
                            :value="item.id">
                    </el-option>
                </el-select>
            </div>
            <div class="search-select screen-container-right display-flex keyword">
                <el-select v-model="search.isRob" @clear="handleClearSelect('isRob')" clearable placeholder="抢购资格">
                    <el-option
                            v-for="item in isRobOpt"
                            :key="item.id"
                            :label="item.value"
                            :value="item.id">
                    </el-option>
                </el-select>
            </div>
            <div class="search-select screen-container-right display-flex keyword v-key">
                <el-input @clear="handleClearSearchInp" clearable v-model="search.keyword" placeholder="请输入您要搜索的内容">
                    <el-select v-model="search.type" slot="prepend" placeholder="请选择">
                        <el-option v-for="(item, index) in searchOpt" :label="item.value"
                                   :value="item.id">
                        </el-option>
                    </el-select>
                    <el-button slot="append" @click="searchData" icon="el-icon-search"></el-button>
                </el-input>
            </div>
<!--            <div class="search-select screen-container-right display-flex keyword">-->
<!--                <el-button @click="openAddDialog('add', '')" size="small" type="primary" plain icon="el-icon-plus">添加-->
<!--                </el-button>-->
<!--                <el-button @click="del" size="small" type="danger" plain icon="el-icon-delete">删除-->
<!--                </el-button>-->
<!--            </div>-->
        </div>
    </div>
    <div class="vue-table background-white color-666">
        <el-table :data="tableData" border highlight-current-row v-loading="listLoading"
                  @sort-change="sortChange" :element-loading-text="loadingText"
                  @selection-change="handleSelectionChange" style="width: 100%">
            <el-table-column prop="is_ok" width="170" label="抢购名额" show-overflow-tooltip
                             align="center">
                <template scope="scope">
                    <el-switch
                            @change="handleRobStatus(scope.row)"
                            active-text="获得"
                            inactive-text="未获得"
                            :inactive-value="2"
                            :active-value="1"
                            v-model="scope.row.is_rob"
                    >
                    </el-switch>
                </template>
            </el-table-column>
            <el-table-column prop="title" width="200" label="活动标题" show-overflow-tooltip
                             align="center"></el-table-column>
            <el-table-column prop="goods_title" width="220" label="商品标题" show-overflow-tooltip
                             align="center"></el-table-column>
            <el-table-column prop="image" width="80" label="商品图" show-overflow-tooltip
                             align="center">
                <template scope="scope">
                    <img :src="scope.row.image" style="border-radius: 10px;width: 48px;height: 48px;padding: 5px">
                </template>
            </el-table-column>
            <el-table-column prop="activity_price" width="100" label="抢购价格" show-overflow-tooltip
                             align="center"></el-table-column>
            <el-table-column prop="nickname" width="150" label="微信昵称" show-overflow-tooltip
                             align="center"></el-table-column>
            <el-table-column prop="avatar" label="头像" show-overflow-tooltip
                             align="center">
                <template scope="scope">
                    <img :src="scope.row.avatar" style="border-radius: 10px;width: 48px;height: 48px;padding: 5px">
                </template>
            </el-table-column>
            <el-table-column prop="mobile" width="150" label="手机号码" show-overflow-tooltip
                             align="center"></el-table-column>
            <el-table-column prop="create_time" width="160" :formatter="dateFormat" label="预约时间" show-overflow-tooltip
                             align="center"></el-table-column>
        </el-table>
        <div class="layout-pagination">
            <el-pagination
                    background
                    @size-change="handleSizeChange"
                    @current-change="handleCurrentChange"
                    :current-page="currentPage"
                    :page-sizes="[10, 20, 50, 100]"
                    :page-size="pageSize"
                    layout="total, sizes, prev, pager, next, jumper"
                    :total="totalCount">
            </el-pagination>
        </div>
    </div>
</div>

<script src="__CDN__/assets/element-ui-2.15.14/js/vue.js"></script>
<script src="__CDN__/assets/element-ui-2.15.14/js/index.js"></script>
<script src="__CDN__/assets/tool/libs/moment.js"></script>
<script src="__CDN__/assets/js/jquery-2.1.1.min.js"></script>